package cn.laixueit.service;

import cn.laixueit.dao.StudentDaoImpl;
import cn.laixueit.dao.StudentDaoImpl2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/*加注解*/
@Service // <bean class="cn.laixueit.service.StudentServiceImpl" id="studentServiceImpl"></bean>
/*@service 标识我们业务逻辑层的类*/
public class StudentServiceImpl {

    /*spring di 注解方式
            1 确定当前类已经被spring管理了
            2 不需要set方法
    * */
    @Autowired
    private StudentDaoImpl2 studentDaoImpl2;

    public void save(){
        System.out.println("Service.save...");
        studentDaoImpl2.save();

    }
}
